﻿package com.plastikaweb.data {

	import flash.display.Sprite;
	import flash.utils.*;
	/**
	 * ...
	 * @author Carlos Matheu Armengol - plastikaweb - 2009
	 */
	public class ClassChecker extends Sprite{
		
		/*
		 * http://www.actionscriptdeveloper.co.uk/getting-the-class-of-an-object-in-as3/
		 * This is great for checking the type of an object.
		 * For example, if you have an object myObj1 and you want to confirm that it is of the same type as myObj2 you can write:
			if (myObj1 is getClass(myObj2)) {
				trace(“These objects are of the same class!”);
			}
		*/
			public static function getClass(obj:Object):Class {
				return Class(getDefinitionByName(getQualifiedClassName(obj)));
			}	
	}
	
}